home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
games
/
gg203.zip
/
SEND.BAS
< prev
next >
Wrap
BASIC Source File
|
1997-02-08
|
5KB
|
160 lines
REM This program will convert "SEND" into "SENDREP.BAT" usable for
REM PEGASUS MAIL.
REM ** WARNING ** ** WARNING ** ** WARNING ** ** WARNING **
REM PEGASUS MUST NOT BE LOADED/RUNNING WHEN YOU EXECUTE THE BATCH FILE
REM It will cause you hell, confusion, and gives you bad feedback :)
REM MOTD.TXT = Message of the Day text file
REM SAMPLE DATA from "SEND"
REM mail_report G777 0 "Player 1" erc118@psu.edu <reports/g777/1.rg7
PRINT "SEND.BAS : Converting SEND and reports for Pegasus Mail batch SENDREP"
OPEN "i", 1, "id.dta"
LINE INPUT #1, pegasus.id$
LINE INPUT #1, galaxy.directory$
LINE INPUT #1, pegasus.full.path$
CLOSE #1
IF pegasus.id$ = "missing_id" THEN
redo.id:
OPEN "o", 1, "id.dta"
PRINT "Enter your Pegasus ID: ";
INPUT pegasus.id$
PRINT "Your ID: "; pegasus.id$, " Correct? (y/n)"
INPUT test$
IF test$ = "Y" OR test$ = "y" THEN
PRINT #1, pegasus.id$
ELSE
CLOSE #1
GOTO redo.id
END IF
redo.galaxy.directory:
PRINT "Enter your Galaxy directory (EXAMPLE: " + q$ + "d:\galaxy\" + q$ + ") ";
PRINT "Final Backslash '\' is important."
INPUT galaxy.directory$
PRINT "Your Galaxy Directory: "; galaxy.directory$, " Correct? (y/n)"
INPUT test$
IF test$ = "Y" OR test$ = "y" THEN
PRINT #1, galaxy.directory$
ELSE
CLOSE #1
GOTO redo.galaxy.directory
END IF
redo.pegasus.full.path:
PRINT "Enter your Pegasus FULL path"
PRINT "(EXAMPLE: " + q$ + "d:\net\pmail\winpm-32.exe" + q$ + ") "
INPUT pegasus.full.path$
PRINT #1, pegasus.full.path$
PRINT "Your Pegasus EXE path: "; pegasus.full.path$, " Correct? (y/n)"
INPUT test$
IF test$ = "Y" OR test$ = "y" THEN
REM
ELSE
CLOSE #1
GOTO redo.pegasus.full.path
END IF
CLOSE #1
END IF
OPEN "i", 1, galaxy.directory$ + "send"
OPEN "o", 2, galaxy.directory$ + "sendrep.bat"
motd.file$ = galaxy.directory$ + "motd.txt"
q$ = CHR$(34)
PRINT #2, "@echo off"
PRINT "Current Pegasus Mail ID: "; pegasus.id$
PRINT "Current Galaxy directory: "; galaxy.directory$
PRINT "Current Pegasus EXE full path: "; pegasus.full.path$
DO
GOSUB get.input
GOSUB get.input: game.name$ = data$
GOSUB get.input: turn$ = data$
GOSUB get.race: race.name$ = data$
GOSUB get.input: email.address$ = data$
GOSUB get.input: bad$ = data$: GOSUB to.dos
report.file.old$ = galaxy.directory$ + RIGHT$(data$, LEN(data$) - 1)
report.file.old$ = LEFT$(report.file.old$, LEN(report.file.old$) - 1)
report.file.new$ = LEFT$(report.file.old$, LEN(report.file.old$) - 4)
GOSUB find.filename
REM ** SHELL "ren " + report.file.old$ + " " + report.file.new$
SHELL "copy " + motd.file$ + " " + report.path.new$ + report.file.new$
SHELL "type " + report.file.old$ + " >>" + report.path.new$ + report.file.new$
SHELL "del " + report.file.old$
REM SHELL "gzip " + report.path.new$ + report.file.new$
REM SHELL "uue " + report.path.new$ + report.file.new$ + ".gz"
REM SHELL "del " + report.path.new$ + report.file.new$ + ".gz"
REM SHELL "del " + report.path.new$ + report.file.new$
REM END
IF email.address$ <> "rko" THEN
PRINT #2, "call " + pegasus.full.path$ + " -A -o -i " + pegasus.id$ + " ";
PRINT #2, "-t " + email.address$ + " ";
PRINT #2, "-s " + q$ + "(" + game.name$ + ") " + race.name$ + " Turn " + turn$ + " Report" + q$ + " ";
PRINT #2, "-f " + report.path.new$ + report.file.new$
END IF
LOOP UNTIL EOF(1)
CLOSE #1
CLOSE #2
PRINT "CLOSE Pegasus Mail and then start 'SENDREP.BAT'"
SYSTEM
get.input:
data$ = ""
read.char$ = INPUT$(1, #1)
WHILE (read.char$ <> " ") AND (read.char$ <> CHR$(10))
data$ = data$ + read.char$
read.char$ = INPUT$(1, #1)
WEND
RETURN
get.race:
data$ = ""
read.char$ = INPUT$(2, #1)
WHILE (read.char$ <> CHR$(34))
data$ = data$ + read.char$
read.char$ = INPUT$(1, #1)
WEND
data$ = data$ + read.char$
read.char$ = INPUT$(1, #1)
REM strip ""
tmp.data$ = data$
data$ = ""
FOR race.inx = 1 TO LEN(tmp.data$)
tmp.char$ = MID$(tmp.data$, race.inx, 1)
IF tmp.char$ = q$ THEN tmp.char$ = "*"
data$ = data$ + tmp.char$
NEXT race.inx
RETURN
to.dos:
data$ = ""
FOR t = 1 TO LEN(bad$)
IF MID$(bad$, t, 1) = "/" THEN
data$ = data$ + "\"
ELSE
data$ = data$ + MID$(bad$, t, 1)
END IF
NEXT t
RETURN
find.filename:
data$ = ""
t.index = LEN(report.file.new$)
DO
data$ = data$ + MID$(report.file.new$, t.index, 1)
t.index = t.index - 1
LOOP UNTIL (MID$(report.file.new$, t.index, 1) = "\")
report.path.new$ = LEFT$(report.file.new$, t.index)
report.file.new$ = ""
FOR t.index = LEN(data$) TO 1 STEP -1
report.file.new$ = report.file.new$ + MID$(data$, t.index, 1)
NEXT t.index
RETURN